﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using NPSoft.Ferrero.Framework.Application;
using Microsoft.Practices.Unity;
using NPSoft.Ferrero.Framework.Web.Test.OtherClass;
using Microsoft.Practices.Unity.InterceptionExtension;
using NPSoft.Ferrero.Framework.Infrastructure.AOP;
using NPSoft.Ferrero.Framework.Infrastructure.Crosscutting;
using NPSoft.Ferrero.Framework.Presentation;

namespace NPSoft.Ferrero.Framework.Web.Test.Config
{
    public class AppConfig : IAppConfig
    {
        public void ConfigureSystem()
        {
            //创建容器  
            INPContainer container = new NPContainerFactory().Create();
            NPWebApp.SetContainer(container);
            // 设置接口拦截，配置拦截器
            NPWebApp.Container.SetDefaultInterceptorFor<IAppService<ModelClass>, ApplicationClass, UserLogBehavior>();
        }

        public INPContainer Container
        {
            get
            {
                NPContainerFactory factory = new NPContainerFactory();
                INPContainer container = factory.Create();
                return container;
            }
        }
    }
}